This repository was archived by the owner on Mar 23, 2023. It is now read-only.
Open
Conversation
Contributor
trotterdylan
left a comment
There was a problem hiding this comment.
Looks like Jenkins upgraded to Go 1.9 so builds are failing. I'll get that fixed.
runtime/list.go
Outdated
| } | ||
| l.mutex.Lock() | ||
| numListElems := len(l.elems) | ||
| start, raised := calcIndex(f, args[1], numListElems) |
Contributor
There was a problem hiding this comment.
Can we instead construct a slice and call DelSlice?
Contributor
Author
There was a problem hiding this comment.
@trotterdylan was thinking same, but some tests are not passing:
--- FAIL: TestListDelSlice (0.00s)
list_test.go:122: TestListDelSlice([1, 2, 3, 4, 5], -1, 3) = [1, 2, 3, 4, 5], want [4, 5]
list_test.go:122: TestListDelSlice([1, 2, 3, 4, 5], 1, -3) = [1, 3, 4, 5], want [1, 2, 3, 4, 5]
from CPython:
>>> x=[1,2,3,4,5]
>>> x.__delslice__(-1, 3)
>>> x
[4, 5]
>>> x=[1,2,3,4,5]
>>> x.__delslice__(1, -3)
>>> x
[1, 2, 3, 4, 5]
>>>
Contributor
Author
There was a problem hiding this comment.
@trotterdylan ok, I will keep index alignment before initiating Slice, it should be enough
Contributor
Author
|
@trotterdylan PTAL |
ghost
approved these changes
Jan 10, 2018
This was referenced Oct 6, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.